Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Log4j2: add option to fill code attributes #12592

Merged
merged 6 commits into from
Nov 14, 2024

Conversation

laurit
Copy link
Contributor

@laurit laurit commented Nov 8, 2024

Resolves #12540

@laurit laurit requested a review from a team as a code owner November 8, 2024 10:44
@trask
Copy link
Member

trask commented Nov 8, 2024

cc @jeanbisutti in case you have a chance to review

StackTraceElement source = sourceSupplier.get();
if (source != null) {
String fileName = source.getFileName();
if (fileName != null) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(optional)

Suggested change
if (fileName != null) {
// file name can be null from the StackTraceElement Javadoc
if (fileName != null) {

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is copy-pasted from the logback instrumentation. Apparently you are the author of it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It could have been better for the Logback instrumentation.

@laurit laurit merged commit 15e611e into open-telemetry:main Nov 14, 2024
56 checks passed
@laurit laurit deleted the log4j2-code-attribute branch November 14, 2024 06:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

MDC attributes not captured with spring boot application using log4j.
3 participants